Skip to main content
POST
End a chat session under the `user_end` reason.

Path Parameters

id
string<uuid>
required

Body

Request body for POST /api/v1/chats/{id}/end. Always finalises the session under the user_end reason (the TTL sweeper uses ttl, the agent uses agent_finish) and runs the same !:TextChatCallLifecycle.FinishAsync pipeline a voice call uses — completion webhook + post-call analysis + persistence.

note
string | null

Optional operator-supplied free-form note appended to the activity log for this finalisation. Not used by the pipeline; purely audit metadata.

Response

Session ended (or was already final).

Public projection of a chat session — what callers see via GET /api/v1/chats/{id} and the list endpoint. Deliberately omits the orchestration State blob, the ExternalIdHash, and the worker hot-flags; those are server-internal.

id
string<uuid>

Session identifier.

agent_id
string | null

Agent driving this session. Frozen at open.

channel
string | null

Channel name (web, twilio_sms, …).

messages
object[] | null

Full conversation transcript so far, in send order.

created_time
string<date-time>

Session creation timestamp (UTC).

last_activity
string<date-time>

Most recent activity timestamp (inbound, outbound or assistant turn).

ttl_seconds
integer<int32> | null

Inactivity timeout in seconds; null when no TTL applies.

is_final
boolean

True once the session has terminated.

status
string | null

Status mirror of DashaAI.BlackBox.AgentAPI.TextChat.Dtos.Chats.ChatSessionDto.IsFinal for list-endpoint filtering (active / final).

final_reason
string | null

Reason for finalisation (ttl, user_end, agent_finish, …).